<?php

class DefaultController extends Controller
{
	public $layout = 'awt-presenter';

	public function actionIndex()
	{
		$jsonpost = '';
		
		if (isset($_POST['lyric'])) {
			$jsonpost = json_encode($_POST);
		}
		
		//$this->redirect(array('search'));
		$this->render('index',array(
			'jsonpost'=>$jsonpost,
		));
	}
	
	# create ppt from queue
	public function actionCreate($id=null) {
		
		# get song info from session queue
		# choose translation
		# customization
		# post and generate ppt
		# log presenter trail
		
		$model = new Song();
		
		if ( !empty($_POST) && isset($_POST['Song']) ) {
			
		}
		
		$this->render('create',array(
			'model'=>$model,
		));
	}
	# search songs choose some to put in queue
	public function actionSearch() {
		
		$this->render('index',array(
		));
	}
	
	# presenter trail history
	public function actionHistory() {
		
		$model = new Song();
		
		$this->render('history',array(
		));
	}
}